package com.yisu.auction.api.core.service.impl.func;

import com.yisu.auction.api.core.mapper.SmsMapper;
import com.yisu.auction.api.core.service.BaseService;
import com.yisu.auction.api.domain.vo.jpushPackageVos.JPushConfigVo;
import com.yisu.auction.ewf.entity.Sms;
import org.joda.time.DateTime;

import javax.annotation.Resource;
import java.util.Date;

/**
 * author: 赵杰
 * Business Description：短信推送公用类
 * createTime：2017/9/13
 */
public class SmsPushUtil extends BaseService {

    /**
     * author: 赵杰
     * Business Description：执行消息推送
     * @param appSign
     * @param memberId
     * @param prizeId
     * @param term
     * @param content
     */
    public void jpushAction(String appSign,long memberId,long prizeId,Integer term,String content)
    {
        JPushConfigVo pushConfigVo2 = getJPushConfigByBingId(appSign);
        JPushUtil.sendWinMsg(pushConfigVo2.getAppKey(), pushConfigVo2.getMasterSecret(),memberId, prizeId, term,content);
    }

    /**
     * 通过bangId,获取极光推送配置
     *
     * @param bingId
     * @return
     */
    public static JPushConfigVo getJPushConfigByBingId(String bingId) {
        JPushConfigVo jPushConfigVo = new JPushConfigVo();
        //疯狂竞拍
        if ("com.ddbaoxiang.auction".equals(bingId)) {
            jPushConfigVo.setAppKey("ea374e4c3587065638e70571");
            jPushConfigVo.setMasterSecret("96bdea99b07d3fe6ad3f4fb6");
            return jPushConfigVo;
        }
        //一锤定金
        if ("com.one.yungou".equals(bingId)||"com.ddbaoxiang.finalword".equals(bingId)) {
            jPushConfigVo.setAppKey("a797bf9f9e23b9035332b31a");
            jPushConfigVo.setMasterSecret("b77f62ccbaa15dc5cb9255c1");
            return jPushConfigVo;
        }
        //惊喜拍
        if ("com.ddbaoxiang.jxpai".equals(bingId)) {
            jPushConfigVo.setAppKey("89ad1c8dd0494be99f94a156");
            jPushConfigVo.setMasterSecret("2dfd4182686469683bc38817");
            return jPushConfigVo;
        }
        return null;
    }
}